package com.example.rabbit.consumer;

import com.example.rabbit.config.DelayedQueueConfig;
import com.example.rabbit.config.SeniorConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;
import java.util.Date;

/**
 *  发送确认 - 高级模式
 * @Author ifredomvip@gmail.com
 * @Date 2022/8/11 17:27
 * @Version 1.0.0
 * @Description
 **/
@Slf4j
@Component
public class SeniorConfirmConsumer {

    @RabbitListener(queues = SeniorConfirmConfig.CONFIRM_QUEUE)
    public void consumerDelayedMessage(Message message) {
        String msg = new String(message.getBody(), StandardCharsets.UTF_8);

        log.info("监听收到消息:" + msg);

    }
}
